<template>
	<view>
		<!-- 顶部 -->
		<view class="top">
			<view class="lp_top">
				<view class="left">
					<u-icon @click='toCity' name='map-fill' :label='place'></u-icon>
				</view>
				<view class="center">
					<u-search placeholder="请输入查询信息" @focus='toSeach' :showAction="false"></u-search>
				</view>
				<view class="right">
					<u-icon name='home-fill' label='地图找房' labelPos='bottom'></u-icon>
				</view>
			</view>
			<!-- 下拉选择 -->
			<view class="lp_center">
				<myDropDown></myDropDown>
			</view>
		</view>
		<!--房子图片文字  -->
		<template>
			<view>
				<houseDetails :list='fwlist' @togoGoodxq='onToGoGoodXq'></houseDetails>
			</view>
		</template>
	</view>
</template>

<script>
	export default {
		// 利用数据存储
		onShow() {
			this.place = '成都'
			this.place = uni.getStorageSync('city')
			// console.log(uni.getStorageSync('city'));
			console.log(this.place);
			this.$api({
				url: `/lp?city=${this.place}`,
				successCB: res => {
					// console.log(res);
					this.fwlist = res.data.data
					console.log(this.fwlist);
					JSON.stringify(uni.setStorageSync('sz', this.fwlist))
				}
			})
			// uni.clearStorageSync()
		},
		data() {
			return {
				place: '',
				fwlist: [] //楼盘首页的房屋数组
			};
		},
		onLoad() {
			
		},
		methods: {
			toCity() {
				uni.navigateTo({
					url: '/pages/city/city'
				})
			},
			toSeach() {
				uni.navigateTo({
					url: '/pages/search/search'
				})
			},
			onToGoGoodXq() {
				// uni.navigateTo({
				// 	url: '../goodsxq/goodsxq'
				// })
			}
		}

	}
</script>

<style lang="less">
	.top {
		// position: absolute;
		z-index: 9999;

	}

	.lp_top {
		margin-top: 20rpx;
		display: flex;
		justify-content: space-around;
		align-items: center;

		.left {
			display: flex;
		}
	}

	/deep/.u-cell__title-text {
		width: 150rpx;
	}
</style>
